home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / Include / sysSysCallParam.h < prev    next >
C/C++ Source or Header  |  1991-05-17  |  4KB  |  130 lines

  1. /*
  2.  * sysSysCallParam.h --
  3.  *
  4.  *    Declarations of constants and types relevant to system call
  5.  *    parameterization.
  6.  *
  7.  * Copyright (C) 1986 Regents of the University of California
  8.  * All rights reserved.
  9.  *
  10.  *
  11.  * $Header: /sprite/src/kernel/sys/RCS/sysSysCallParam.h,v 9.2 91/05/17 18:25:03 kupfer Exp $ SPRITE (Berkeley)
  12.  */
  13.  
  14. #ifndef _SYSSYSCALLPARAM
  15. #define _SYSSYSCALLPARAM
  16.  
  17. #ifdef KERNEL
  18. #include <sys.h>
  19. #else
  20. #include <kernel/sys.h>
  21. #endif
  22.  
  23. /*
  24.  * For each parameter to a system call, there are several possible
  25.  * dispositions:
  26.  *
  27.  *    SYS_PARAM_IN        - Pass the value of the parameter into the
  28.  *                  system call.
  29.  *    SYS_PARAM_OUT        - Copy the value returned by the system
  30.  *                  call back into the location specified
  31.  *                - By the pointer argument.
  32.  *    SYS_PARAM_ACC        - Indicates that the argument is to
  33.  *                  be made accessible.
  34.  *    SYS_PARAM_COPY        - Indicates that the argument is to
  35.  *                  be copied into and/or out of kernel memory.
  36.  *    SYS_PARAM_NIL        - If set in disposition field during RPC,
  37.  *                  indicates that the corresponding pointer
  38.  *                  was NIL.
  39.  *    SYS_PARAM_ARRAY        - Indicates that the argument is a pointer
  40.  *                  to an array of the specified type.  The
  41.  *                  size of the array must be specified as the
  42.  *                  preceding argument.  If multiple arrays
  43.  *                  are specified as successive args, then they
  44.  *                  each are assumed to have the same number
  45.  *                  of arguments.
  46.  */
  47.  
  48. #define SYS_PARAM_IN        0x0001
  49. #define SYS_PARAM_OUT        0x0002
  50. #define SYS_PARAM_ACC        0x0010
  51. #define SYS_PARAM_COPY        0x0020
  52. #define SYS_PARAM_NIL        0x0100
  53. #define SYS_PARAM_ARRAY        0x1000
  54.  
  55. /*
  56.  * Define constants to indicate types of arguments.  The value of the
  57.  * argument type may be used to simplify packaging of the arguments
  58.  * (for example, int's do not need to be made accessible).  It is also
  59.  * used as a subscript into an array of sizes corresponding to each type.
  60.  *
  61.  * Most of the types are self-explanatory, with the exception of Time values.
  62.  * Time structures are two words, and they are sometimes passed by value
  63.  * (on the stack) and sometimes by reference.  TIMEPTR is used to indicate
  64.  * a Time that is passed by reference, and TIME1/TIME2 are used for a Time
  65.  * that is passed by value.  TIME1 and TIME2 are just like ints and are
  66.  * treated like two separate arguments in order to reduce the number of special
  67.  * cases in the parameter parsing routines.
  68.  *
  69.  * SYS_PARAM_INT    -    integer
  70.  * SYS_PARAM_CHAR    -    character (for input, will cause problems due
  71.  *                to the number of bytes!)
  72.  * SYS_PARAM_PROC_PID    -     Proc_PID
  73.  * SYS_PARAM_PROC_RES   -    Proc_ResUsage
  74.  * SYS_PARAM_SYNC_LOCK    -    Sync_Lock
  75.  * SYS_PARAM_FS_ATT    -    Fs_Attributes
  76.  * SYS_PARAM_FS_NAME    -    string containing a path name: call
  77.  *                Fs_MakeNameAccessible.
  78.  * SYS_PARAM_TIMEPTR    -    Time: only used as OUT or INOUT (ie, pointer)
  79.  * SYS_PARAM_TIME1    -    first word of a Time being passed IN
  80.  * SYS_PARAM_TIME2    -    second word of a Time structure.
  81.  * SYS_PARAM_VM_CMD    -    Vm_Command
  82.  * SYS_PARAM_DUMMY    -    A placeholder for cases in which the
  83.  *                number of arguments is different from the
  84.  *                number of words.
  85.  * SYS_PARAM_RANGE1    -    Start of range of values for array subscripts
  86.  * SYS_PARAM_RANGE2    -    End of range for array.
  87.  * SYS_PARAM_PCB    -    Process control block.
  88.  * SYS_PARAM_FS_DEVICE    -    Device specification.
  89.  */
  90.  
  91. #define SYS_PARAM_INT            0
  92. #define SYS_PARAM_CHAR            1
  93. #define SYS_PARAM_PROC_PID              2
  94. #define SYS_PARAM_PROC_RES              3
  95. #define SYS_PARAM_SYNC_LOCK             4
  96. #define SYS_PARAM_FS_ATT                5
  97. #define SYS_PARAM_FS_NAME               6
  98. #define SYS_PARAM_TIMEPTR               7
  99. #define SYS_PARAM_TIME1                 8
  100. #define SYS_PARAM_TIME2                 9
  101. #define SYS_PARAM_VM_CMD                10
  102. #define SYS_PARAM_DUMMY            11
  103. #define SYS_PARAM_RANGE1        12
  104. #define SYS_PARAM_RANGE2        13
  105. #define SYS_PARAM_PCB            14
  106. #define SYS_PARAM_FS_DEVICE        15
  107. #define SYS_PARAM_PCBARG        16
  108.  
  109. typedef struct {
  110.     int type;
  111.     int disposition;
  112. } Sys_CallParam;
  113.  
  114. /*
  115.  * Define a structure for passing system call parameters to a routine
  116.  * regardless of the number of arguments.
  117.  */
  118.  
  119. typedef struct {
  120.     int argArray[SYS_MAX_ARGS];
  121. } Sys_ArgArray;
  122.  
  123. /*
  124.  * Array of sizes of system call parameters, declared in sysSysCall.c.
  125.  */
  126.  
  127. extern int *sys_ParamSizes;
  128.  
  129. #endif /* _SYSSYSCALLPARAM */
  130.